<template>
	<div>
		<div class="Abox" v-loading="loading">
			<Info
				ref="Info"
				v-model="infoData"
				v-bind="querys"
				state="readonly"></Info>
			<Contract
				ref="Contract"
				v-model="infoData"
				v-bind="querys"
				:showHistory="false"
				state="readonly"></Contract>
			<Footer
				ref="Footer"
				v-model="infoData"
				v-bind="querys"
				state="readonly"></Footer>
			<!-- <el-button -->
			<!-- class="orderChangeHistory" -->
			<!-- type="primary" -->
			<!-- @click="toOrderChangeHistory"> -->
			<!-- 查看变更历史记录 -->
			<!-- </el-button> -->
		</div>
	</div>
</template>

<script>
	import * as apis from '@/api/order/mainOrder/contractChange/api.js';
	import Info from '../chunk/info/index.vue';
	import Contract from '../chunk/contract/index.vue';
	import Footer from '../chunk/adjust/footer/index.vue';
	export default {
		name: 'minorOrderContractChange',
		props: {
			value: {
				required: false,
			},
			state: {
				required: false,
			},
		},
		components: { Info, Contract, Footer },
		data() {
			return {
				querys: {},
				loading: false,
				dictList: {
					changeType: [
						{
							label: '出租方',
							value: '1',
						},
						{
							label: '承租方',
							value: '2',
						},
						{
							label: '租赁期限',
							value: '4',
						},
						{
							label: '车辆',
							value: '8',
						},
						{
							label: '租金调整',
							value: '16',
						},
						{
							label: '租金',
							value: '32',
						},
						{
							label: '保险',
							value: '64',
						},
						{
							label: '维保',
							value: '128',
						},
						{
							label: '替车',
							value: '256',
						},
						{
							label: '加装',
							value: '512',
						},
						{
							label: '其他费用',
							value: '1024',
						},
					],
				},
			};
		},
		computed: {
			infoData: {
				get() {
					return this.useVModel.call(this);
				},
				set(val) {
					this.$emit('input', val);
				},
			},
		},
		created() {
			this._onload();
		},
		mounted() {},
		methods: {
			onload() {
				// let changeType = [];
				// this.dictList.changeType?.map(item => {
				// 	if ((this.infoData.changeType & (item.value * 1)) > 0) {
				// 		changeType.push(item.value);
				// 	}
				// });
				// this.infoData.changeType = changeType;
			},
			flow_submit() {
				// let changeType = this.infoData.changeType.reduce(
				// 	(prev, next) => {
				// 		return prev | next;
				// 	},
				// );
				// this.infoData.changeType = changeType;
			},
			// submit() {
			// 	let params = this._.cloneDeep(this.infoData);
			// 	if (this.Empty(params.auditContent)) {
			// 		params.auditContent = null;
			// 	}
			// 	apis.Submit(params);
			// },
			toOrderChangeHistory() {
				this._toPage({
					name: 'MinOrderChangeHistory',
					query: {
						orderCarId: this.querys.orderCarId,
					},
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.orderChangeHistory {
		position: fixed;
		bottom: calc(100vh - 150px);
		right: 40px;
		cursor: pointer;
		transition: all 0.3s;
	}
	.handle {
		height: 60px;
		display: flex;
		justify-content: flex-end;
		align-items: center;
		background-color: #fff;
		margin: 20px;
		padding: 0 20px;
		border-radius: 8px;
		box-sizing: border-box;
	}
</style>
